﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Qwen_for_Windows.Pages
{
    /// <summary>
    /// SettingPage.xaml 的交互逻辑
    /// </summary>
    public partial class SettingPage : Page
    {
        public SettingPage()
        {
            InitializeComponent();
            SettingPageLoad();
        }

        private void SettingPageLoad()
        {
            ApiKeyTextBox.Text = Model.App_Model.API_Key;
            ModelNameTextBox.Text = Model.App_Model.Model_Name;
            BaseUrlTextBox.Text = Model.App_Model.Base_URL;
        }

        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            Model.App_Model.Save2XML(ApiKeyTextBox.Text, ModelNameTextBox.Text, BaseUrlTextBox.Text);
            MessageBox.Show("保存成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
        }
    }
}
